import { LOADING, LOGIN, THEME } from './axtionTypes';
import ThemeConfig from '@/config/theme';

const initialState = {
  theme: {},
  loading: false,
  login: false,
  formType: ThemeConfig.formType || 'DrawerForm',
};

const Theme = (state = initialState, action: { type: string; data: any }) => {
  switch (action.type) {
    case THEME:
      return { ...state, theme: action.data };
    case LOGIN:
      return { ...state, login: action.data };
    case LOADING:
      return { ...state, loading: action.data };
    default:
      return state;
  }
};
export default Theme;
